package com.zhenhao.xsq.utils;

import android.content.Context;
import android.content.SharedPreferences;

public class SpUtil {
	//用来保存版本号
	private static SharedPreferences sp;
	
	public static void putInt(Context context, String key, int value) {
		if(sp ==null) {
			sp = context.getSharedPreferences("config", Context.MODE_PRIVATE);
		}
		sp.edit().putInt(key, value).commit();
	}	
	
	public static int getInt(Context context, String key, int defValue) {
		if(sp ==null) {
			sp = context.getSharedPreferences("config", Context.MODE_PRIVATE);
			
		}	
		return sp.getInt(key, defValue);
	}

}
